import requests


def reply_message(msg):
    url = f'http://api.qingyunke.com/api.php?key=free&appid=0&msg={msg}'
    response = requests.get(url)
    if response.status_code == 200:
        return response.json()['content']
    else:
        return '消息获取失败！'


if __name__ == '__main__':
    msg = reply_message('讲个笑话')
    print(msg)
